package cn.vcjf.weapp.api.setting.entity;

import cn.vcjf.weapp.common.web.PageModel;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * <p>
    * 
    * </p>
 *
 * @author zhengzihang
 * @since 2018-09-25
 */
@TableName("vc_order_option")
public class OrderOption extends PageModel<OrderOption> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 配置key
     */
    private String key;

    /**
     * 标签
     */
    private String label;

    /**
     * 描述
     */
    private String description;

    /**
     * 排序
     */
    private Integer seq;

    /**
     * 配置的数值
     */
    private String value;

    /**
     * 单位
     */
    private String unit;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }
    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }
    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
    public Integer getSeq() {
        return seq;
    }

    public void setSeq(Integer seq) {
        this.seq = seq;
    }
    public void setValue(String value) {
        this.value = value;
    }
    public void setIntValue(Integer value) {
        this.value = value+"";
    }
    public String getValue() {
        return value;
    }
    @JsonIgnore
    public Integer getIntValue() {
        Integer val = null;
        try{
            val = Integer.parseInt(value);
        }catch (Exception e){
            e.printStackTrace();
        }
        return val;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    @Override
    public void preInsert(){
        super.preInsert();
    }
    @Override
    public void preUpdate(){
        super.preInsert();
    }
    @Override
    public String toString() {
        return "OrderOption{" +
        "id=" + id +
        ", key=" + key +
        ", label=" + label +
        ", description=" + description +
        ", seq=" + seq +
        ", value=" + value +
        ", unit=" + unit +
        ", createUser=" + createUser +
        ", createTime=" + createTime +
        ", updateUser=" + updateUser +
        ", updateTime=" + updateTime +
        ", deleteFlag=" + deleteFlag +
        ", sysUserId=" + sysUserId +
        "}";
    }
}
